import request from '../utils/request'

// 用户登录
export function login(data: { username: string; password: string }) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

// 用户注册
export function register(data: { username: string; password: string; email: string }) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

// 更新用户信息
export function updateUserInfo(data: { username?: string; avatar?: string; email?: string }) {
  return request({
    url: '/user/update',
    method: 'put',
    data
  })
} 